{template '../header'}
<script type="text/javascript">
    // 页面跳转
    var url = "{:urldecode($url)}";
    var backstep = parseInt("{$backstep}");
    
    function goToPage() {
        if (backstep > 0) {
            history.go(-backstep);
        } else {
            if (url == '') {
                history.back();
            } else if (url == 'close') {
                closeWin();
            } else if (url == 'stop') {
                ;
            } else {
                location.replace(url);
            }
        }
    }

    // 倒计时时间
    var time = {$time};
    function autoTimeShow() {
        --time;
        if (time < 0) {
            document.getElementById('showTime').innerHTML = '';
            goToPage();
            return;
        }
        document.getElementById('showTime').innerHTML = '(' + time + ')';
        setTimeout(autoTimeShow, 1000);
    }

    $(function () {
        autoTimeShow();
    });

    function closeWin() {
        try {
            window.opener = window;
            var win = window.open("", "_self");
            win.close();
            //frame的时候
            top.close();
        } catch (e) {

        }
    }

</script>

<div class="col-12 navbar-expand-lg no-gutters p-0 mb-2">
    <nav class="navbar navbar-dark justify-content-between">
        <a class="navbar-brand" href="#">
            <img src="/logo.png" class="navbar-icon">
            {:\Sys('site_name')}
        </a>
    </nav>
</div>
<div class="card mt-5 mb-5 mx-auto w-25">
    <div class="card-header">
        消息提示
    </div>
    <div class="card-body">
        <?php echo $msg?>
    </div>
    <div class="card-footer">
        <button type="button" class="btn btn-{$style}" onclick="goToPage();">确定<span id="showTime">（{$time}）</span></button>
    </div>
</div>

{template '../footer'}
